#include<iostream>
#include<string.h>
#include"ShareMenory.hpp"
#include"Time.hpp"
#include"Fifo.hpp"

int main()
{
    shm.GetShm(); //获取共享内存
    shm.AttchShm(); //挂载到虚拟内存
    gpipe.OpenPipeForWrite(); //写入式打开管道
    //在这里进行IPC
    struct data *image = (struct data *)shm.GetAddr();

    char ch = 'A';
    while(ch <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lasttime, GetCurrTime().c_str());
        strcpy(image->image, "123456789xxxxx");

        gpipe.Signal(); //向管道进行写入发送信号
        sleep(3);
    }
    shm.DetachShm(); //移除挂载
    return 0;
}